package com.bstek.pms.tools.model;

import com.bstek.pms.tools.ui.MyCheckbox;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description 表对象
 * @Author hans
 * @CreateDate 2020-6-27
 */
public class TableInfo implements Comparable<TableInfo>{
    private  String rowIndex;
    private String tableName;
    private  String tableConment;
    private MyCheckbox cb=new MyCheckbox();
    private boolean isPrefix;

    /**
     * 联合主键列表
     */
    private List<ColumnInfo> uPrimaryKey = new ArrayList<ColumnInfo>();
    /**
     * 唯一约束列表
     */
    private List<ColumnInfo> uniqueKey = new ArrayList<ColumnInfo>();
    /**
     * 表的列信息
     */
    private List<ColumnInfo> cols = new ArrayList<ColumnInfo>();

    public TableInfo(){}

    public  TableInfo(String rowIndex,String tableName,String tableConment){
        this.rowIndex=rowIndex;
        this.tableName=tableName;
        this.tableConment=tableConment;
    }

    public String getRowIndex() {
        return rowIndex;
    }

    public void setRowIndex(String rowIndex) {
        this.rowIndex = rowIndex;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getTableConment() {
        return tableConment;
    }

    public void setTableConment(String tableConment) {
        this.tableConment = tableConment;
    }

    public MyCheckbox getCb() {
        return cb;
    }

    public void setCb(MyCheckbox cb) {
        this.cb = cb;
    }

    public List<ColumnInfo> getuPrimaryKey() {
        return uPrimaryKey;
    }

    public void setuPrimaryKey(List<ColumnInfo> uPrimaryKey) {
        this.uPrimaryKey = uPrimaryKey;
    }

    public List<ColumnInfo> getUniqueKey() {
        return uniqueKey;
    }

    public void setUniqueKey(List<ColumnInfo> uniqueKey) {
        this.uniqueKey = uniqueKey;
    }

    public List<ColumnInfo> getCols() {
        return cols;
    }

    public void setCols(List<ColumnInfo> cols) {
        this.cols = cols;
    }

    public boolean isPrefix() {
        return isPrefix;
    }

    public void setPrefix(boolean prefix) {
        isPrefix = prefix;
    }

    @Override
    public String toString() {
        return "TableInfo{" +
                "rowIndex='" + rowIndex + '\'' +
                ", tableName='" + tableName + '\'' +
                ", tableConment='" + tableConment + '\'' +
                '}';
    }


    @Override
    public int compareTo(TableInfo o) {

        return this.tableName.compareTo(o.getTableName());
    }
}
